GtkNotebook: Don't let tab allocation go negative
authorMatthias Clasen <mclasen@redhat.com>
Thu, 3 Mar 2011 23:24:58 +0000 (18:24 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 3 Mar 2011 23:30:03 +0000 (18:30 -0500)
gtk/gtknotebook.c

index e50dc6f40c8eb70daa5f2817f3d127e9e3d0f02b..a7740d5069887bc8e2277eb884224ea20ec0636c 100644 (file)
@@ -5740,7 +5740,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook  *notebook,
         {
         case GTK_POS_TOP:
         case GTK_POS_BOTTOM:
-          child_allocation.width = page->requisition.width + tab_overlap + tab_extra_space;
+          child_allocation.width = MAX (1, page->requisition.width + tab_overlap + tab_extra_space);
 
           /* make sure that the reordered tab doesn't go past the last position */
           if (priv->operation == DRAG_OPERATION_REORDER &&
@@ -5795,7 +5795,7 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook  *notebook,
           break;
         case GTK_POS_LEFT:
         case GTK_POS_RIGHT:
-          child_allocation.height = page->requisition.height + tab_overlap + tab_extra_space;
+          child_allocation.height = MAX (1, page->requisition.height + tab_overlap + tab_extra_space);
 
           /* make sure that the reordered tab doesn't go past the last position */
           if (priv->operation == DRAG_OPERATION_REORDER &&